{
	//es3  数据保护
	var Person = function(){
		var data = {
			name:'es3',
			sex:'male',
			age:15
		}
		this.get = function(key){
			return data[key]
		}
		this.set=function(key,value){
			if(key!=='sex'){
				data[key] = value
			}
		}
	}
	var person = new Person();
	console.table({
		name:person.get('name'),
		sex:person.get('sex'),
		age:person.get('age'),
	})
}

{
	//es5 数据保护
	var Person = {
		name:'es3',
		age:15
	}
	Object.defineProperty(Person,"sex",{
		writable:false,
		value:'male'
	})
}

{
	//es6
	let Person = {
		name:'es3',
		age:15,
		sex:'male'
	}
	let pserson = new Proxy(Person,{
		get(traget,key){
			console.log(traget,key)
			return traget[key]
		},
		set(traget,key,val){
			if(key !=="sex"){
				traget[key] = val
			}
		}
	})
	console.table({
		name:pserson.name,
		age:pserson.age,
		sex:pserson.sex
	})
}